/*
 * $Id: ProgrammePlanProjectionType.java 1695 2011-08-29 08:24:11Z abie $
 * 
 * Copyright (c) 2001-2008 Accentrix Company Limited. All Rights Reserved.
 * 
 * Accentrix Company Limited. ("Accentrix") retains copyright on all text, source
 * and binary code contained in this software and documentation. Accentrix grants
 * Licensee a limited license to use this software, provided that this copyright
 * notice and license appear on all copies of the software. The software source
 * code is provided for reference purposes only and may not be copied, modified 
 * or distributed.
 * 
 * THIS SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS," WITHOUT ANY WARRANTY OF
 * ANY KIND UNLESS A SEPARATE WARRANTIES IS PURCHASED FROM ACCENTRIX AND REMAINS
 * VALID.  ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ACCENTRIX SHALL NOT BE LIABLE
 * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING OR MODIFYING THE
 * SOFTWARE OR ITS DERIVATIVES.
 * 
 * IN NO EVENT WILL ACCENTRIX BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
 * HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE
 * USE OF OR INABILITY TO USE SOFTWARE, EVEN IF ACCENTRIX HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */
package com.lightsaber.trade.cloth.entity.programme;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.lightsaber.trade.core.entity.BaseEntity;

@Entity
@Table(name = "MHPP_PROJECTION_TYPE")
public class ProgrammePlanProjectionType extends BaseEntity {

    private static final long serialVersionUID = 5463400564423843340L;

    @Column(name = "YEAR", nullable = false)
    private Integer year;

    @Enumerated(EnumType.STRING)
    @Column(name = "PLAN_PROJECTION_TYPE", length = 30)
    private PlanProjectionType planProjectionType;

    /**
     * used to store value when planProjectionType is SelfDefinedProgressionRate
     */
    @Column(name = "SELF_DEFINED_PROGRESSION_RATE", length = 4, nullable = true)
    private Float selfDefinedProgressionRate;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PROGRAMME_ID")
    private BaseProgramme programme;

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SUBJECT_GROUP_PORGRAMME_ID")
    private Programme subjectGroupPorgramme;

    public Integer getYear() {
        return year;
    }

    public void setYear(final Integer year) {
        this.year = year;
    }

    public PlanProjectionType getPlanProjectionType() {
        return planProjectionType;
    }

    public void setPlanProjectionType(final PlanProjectionType planProjectionType) {
        this.planProjectionType = planProjectionType;
    }

    public BaseProgramme getProgramme() {
        return programme;
    }

    public void setProgramme(final BaseProgramme programme) {
        this.programme = programme;
    }

    public Programme getSubjectGroupPorgramme() {
        return subjectGroupPorgramme;
    }

    public void setSubjectGroupPorgramme(final Programme subjectGroupPorgramme) {
        this.subjectGroupPorgramme = subjectGroupPorgramme;
    }

    public Float getSelfDefinedProgressionRate() {
        return selfDefinedProgressionRate;
    }

    public void setSelfDefinedProgressionRate(Float selfDefinedProgressionRate) {
        this.selfDefinedProgressionRate = selfDefinedProgressionRate;
    }




}
